
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
      $(function(){  
      getProData();
         $("#update_version_dialog").dialog({
		    autoOpen : false,
		    width : 700,
		    draggable : true,
		    resizable : false,
		    height:150,
		    buttons : [ {
		      text : "提交",
		      click : function() {
		      	  updateSysPro();
		     	 $(this).dialog("close");		      	
		      }
		    }, {
		      text : "取消",
		      click : function() {
		        $(this).dialog("close");
		        
		      }
		    } ]
	  });
	  
        $(".list_table").colResizable({
          liveDrag:true,
          gripInnerHtml:"<div class='grip'></div>", 
          draggingClass:"dragging", 
          minWidth:30
        }); 
        
        
        
      }); 
     $(function() {
           $("#checkAll").click(function() {
                $('input[name="subBox"]').attr("checked",this.checked); 
            });
            var $subBox = $("input[name='subBox']");
            $subBox.click(function(){
                $("#checkAll").attr("checked",$subBox.length == $("input[name='subBox']:checked").length ? true : false);
            });
            	///添加顶级分类(ajax post 提交)
	    $("#add_topcategory").click(function(e) {
	    
	     });
	     


        });
        
        //update
    function openupdate(pkey,pvalue){
        closeOtherJDialog();
        $("#key").val(pkey);
        $("#value").val(pvalue);
	    $("#update_version_dialog").dialog('open');
	  }

function updateSysPro(){
    var pkey=$.trim($("#key").val());
    var pvalue=$.trim($("#value").val());
    
     if(pvalue.length==0){
      alert("请输入正确的参数!");
    } 
   $.ajax( {
		type : "POST",
		url : "updateSysProgram.do",
		data:{"pkey":pkey,"pvalue":pvalue},
		dataType: "json",
		async : false,
		success : function(data) {
			if(data.code=="0000"){
	       		 alert("操作成功!");
	       		 location.reload();
	       }else{
	           alert(data.code+"操作失败，请稍后重试!");
	       }
		}
		
	});     
	}
	  function querypic(id){
     	window.location.href="<%=request.getContextPath()%>/back/student/querypic.do?name=2&schoolId="+id;
     }
     
      function getProData()  
	    {  
	        $.ajax({          
	             url:"<%=request.getContextPath()%>/back/school/getPro.do",  
	             type : "post",    
	             cache : false,    
	             dataType : "json",   
	             error:function(){  
	             },  
	             success:function(data){
	                var categoryId = document.getElementById('proName');  
	                //清空数组  
	                for(var i=0;i<data.length;i++){  
	                     var xValue=data[i].id;    
	                     var xText=data[i].name;    
	                     var option=new Option(xText,xText);    
	                     categoryId.add(option);    
	                }  
	               
	           }  
	       });  
	    }
	     function getCityData()  
	    {  
	        var pid = $("#proName").val();  
	        $.ajax({          
	             url:"<%=request.getContextPath()%>/back/school/getCity.do", 
	             data: {"proId":pid}, 
	             type : "post",    
	             cache : false,    
	             dataType : "json",   
	             error:function(){  
	             },  
	             success:function(data){
	            
	                var categoryId = document.getElementById('cityName');  
	                //清空数组  
	                categoryId.length = 0;  
	                for(var i=0;i<data.length;i++){  
	                     var xValue=data[i].id;    
	                     var xText=data[i].name;    
	                     var option=new Option(xText,xText);    
	                     categoryId.add(option);    
	                }  
	               
	           }  
	       });  
	    }
   </script>
<title>名校管理</title>


</head>
<body  >
	<div class="container">
		<div class="main_top">

			<div class="main_right fr span10">

				<div class="box pl5">
					<div class="box_border">
						<div class="box_top">
							<div class="box_top_l fl">
								<b class="pl15">数据</b>
							</div>
						</div>
						<form id="form1" method="post" action="<%=request.getContextPath()%>/back/student/query.do">
								<div class="searchDiv fl">
						
									<b>按学生名搜索</b>
									 <input type="text" name="name" class="input-text lh30" style="width:300px" maxlength="50" value="${PageBean.name }">  
									 <b>按学校搜索</b>
									 <input type="text" name="schoolName" class="input-text lh30" style="width:300px" maxlength="50" value="">  
									  <select name="proName" id="proName" class="input-text_popup_form"  style="width:100px" maxlength="150" onchange="getCityData();" >
									   <option value="">选择省份</option>
									  </select>	
									  <select name="cityName" id="cityName" class="input-text_popup_form"  style="width:100px" maxlength="150" >
									  <option value="">选择城市</option>
									  </select>
									 <input type="submit" value="搜索" class="btn btn82 btn_search">

								</div>
						
							</form>
						<div class="box_center">
							<div id="table" class=" fl mt10">
								<div class="box span10 oh">
									<table width="100%" border="0" cellpadding="0" cellspacing="0"
										class="list_table">
										<tr>
											<th width="1.5%">序号</th>
											<th width="7%">学生名称</th>
											<th width="5%">学生头像</th>
											<th width="5%">所属学校</th>
											<th width="5%">所属老师</th>
											<th width="5%">作品数量</th>
											<th width="5%">积分值</th>
											<th width="5%">操作</th>
										</tr>
										<c:if test="${fn:length(studentListBean)==0}"><tr class="tr"><td align="center" colspan="8">暂无数据</td> </tr></c:if>
										<c:if test="${fn:length(studentListBean)>0}">
										<c:forEach items="${studentListBean}" var="manager" varStatus="abc">
											<tr class="tr">
											    <td align="center"><c:out value="${(PageBean.currentpage-1)*PageBean.pagesize+abc.index + 1}" /></td>
												<td align="center"><c:out value="${manager.studentName}" /></td>
												<td align="center"><a href="<%=imgPath %>${manager.studentLogo}" data-lightbox="image-1"   > <IMG alt="学生头像" width="50" height="50" src="<%=imgPath %>${manager.studentLogo}"/></a></td>
												<td align="center"><c:out value="${manager.schoolName}" /></td>
												<td align="center"><c:out value="${manager.teacherName}" /></td>
												<td align="center"><c:out value="${manager.worksNum}" /></td>
												<td align="center"><c:out value="${manager.integralValue}" /></td>
												<td align="center">
												<input type="button" class="new_btn new_btn_up" onclick="querypic('${manager.studenId}')" value="查看图片">
												  </td>
											</tr>
										</c:forEach>
                                     </c:if>
									</table>
									<div class="fr fontblack mt25 mb20 mr20">
										每页条数：<a href="<%=request.getContextPath()%>/back/student/query.do?pz=5"
											class="${pageSize == 5 ? 'fontpink' : ''}">5</a> | <a
											href="<%=request.getContextPath()%>/back/student/query.do?pz=10"
											class="${pageSize == 10 ? 'fontpink' : ''}">10</a> | <a
											href="<%=request.getContextPath()%>/back/student/query.do?pz=20"
											class="${pageSize == 20 ? 'fontpink' : ''}">20</a>
									</div>
									<div class="fr fontblack mt5 mb20 mr20">
										<jsp:include page="../template/commonPagination.jsp">
											<jsp:param name="url" value="query.do?"></jsp:param>
										</jsp:include>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="clear"></div>
		</div>

	</div>
	
	 <!-- 添加分类dialog start -->
	<div id="update_version_dialog" title="更新系统参数信息" style="display:none;">
		<div class="box span10 oh">
			<table class="list_table"  id="tb_version_update" >
	            <tr class="tr">
					<td align="center">value:</td>
					<td><input type="text" id="value" name="value" class="input-text lh30" style="width:300px" maxlength="150">
					   <input type="hidden" id="key" name="key">
					</td>
				</tr><tr class="tr">
			</table>
		</div>
		</div>
		
		
</body>

</html>
